/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.facade.main.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.facade.main.httpunit.HttpHelper;
import com.facade.main.httpunit.HttpProperty;
import java.util.HashMap;
import java.util.Map;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author Administrator
 */
@RestController
public class PrivateControoller {
    //对外接口，实现新订单通知
    @RequestMapping(value = "/order/add", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public String orderAdd(@RequestBody JSONObject json){
        boolean isAdd = false;
        //TODO 获取json数据后做相应入库
        Map<String, Object> res = new HashMap<>();
        res.put("msg", "");
        res.put("data", null);
        res.put("trace_id", "123456");
        if(isAdd){
            res.put("rc", 0);
        }
        else{
            res.put("rc", 1);
        }
        return JSON.toJSONString(res);
    }
}
